<{include file="admin/header.html"}>	

			<ul id="main-nav">  <!-- Accordion Menu -->
				
				<li>
					<a href="<{spUrl c=admin a=index}>" class="nav-top-item no-submenu">控制面板</a>       
				</li>
				
				<li> 
					<a href="#" class="nav-top-item current">文章</a>
					<ul>
						<li><a href="<{spUrl c=post a=write}>">撰写新文章</a></li>
						<li><a href="<{spUrl c=post a=index}>">文章管理</a></li>
						<li><a class="current" href="<{spUrl c=category a=index}>">分类管理</a></li>
					</ul>
				</li>
				
				<li>
					<a href="#" class="nav-top-item">页面和区块</a>
					<ul>
						<li><a href="<{spUrl c=page a=write}>">撰写新页面</a></li>
                        <li><a href="<{spUrl c=area a=write}>">撰写新区块</a></li>
						<li><a href="<{spUrl c=page a=index}>">页面管理</a></li>
						<li><a href="<{spUrl c=area a=index}>">区块管理</a></li>
					</ul>
				</li>
				
				<li>
					<a href="#" class="nav-top-item">设置</a>
					<ul>
						<li><a href="<{spUrl c=user a=edit uid=$smarty.session.userinfo.uid}>">个人信息</a></li>
						<li><a href="<{spUrl c=user a=index}>">用户和权限</a></li>
					</ul>
				</li>      
				
			</ul> <!-- End #main-nav -->
			
		</div></div> <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
						
			<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>分类管理</h3>
					<ul class="content-box-tabs">
						<li><a href="#tab1" class="default-tab">管理</a></li> <!-- href must be unique and match the id of target div -->
						<li><a href="#tab2">添加新分类</a></li>
					</ul>
					
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
<div class="tab-content default-tab" id="tab1">
				  <table>
<thead>
	<tr>
	<th>ID</th>
	<th>分类名称</th>
	<th>状态</th>
	<th>操作</th>
	</tr>
</thead>
	
<{foreach from=$results item=one}>  

  <tr>
    <td><{$one.id}></td>
    <td <{if $one.parent==0}>style="font-weight:bolder;"<{/if}>><a href="<{spUrl c=category a=edit parent=$one.parent id=$one.id}>"><{$one.name}></a></td>
    <td><{if $one.status == "1"}><font color='red'>隐藏</font><{else}>显示<{/if}></td>
    <td>
		<!-- Icons -->
		<a href="<{spUrl c=category a=write parent=$one.id}>" title="Add"><img src="/resources/images/icons/add.png" alt="Add" /></a>
		<a href="<{spUrl c=category a=edit id=$one.id}>" title="Edit"><img src="/resources/images/icons/pencil.png" alt="Edit" /></a>
		<a href="javascript:void(0);" onclick="delconfirm(<{$one.id}>,'<{$one.name}>');" title="Delete"><img src="/resources/images/icons/cross.png" alt="Delete" /></a> 	
	</td>
  </tr>

<{/foreach}>
</table>
</div> 
					<!-- End #tab1 -->
					
					<div class="tab-content" id="tab2">
					<form id="form1" name="form1" method="post" action="<{spUrl c=category a=add}>">
						<fieldset>
									  <p>
							    <label>文章类别</label>
							    <select name="parent" class="small-input">
<option value="0" style="background:#FFCC00;">==根目录==</option>
<{foreach from=$results item=one}>  
<option value="<{$one.id}>"><{$one.name}></option>
<{/foreach}>
</select>
							  </p>						
							  <p>
								<label>分类标题</label>
									<input class="text-input medium-input" type="text" id="medium-input" name="name" />
							    <input type="checkbox" name="status" value="1" />
隐藏</p>
                                <p>
								  <label>缩略名&nbsp;&nbsp;<font color="red">*</font></label>
										<input class="text-input small-input" type="text" id="small-input" name="slug" />
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								  <input class="text-input smaller-input" type="text" id="small-input2" name="sort" />
权重
</p>
<p>
			  <label>缩略图</label>
										<input class="text-input medium-input" type="text" id="large-input" name="thumb" /><br />不超过200个字，用半角;分割
							  </p>

						    <p>
								  <label>
					    分类描述</label>
								  <textarea class="text-input textarea" id="textfield" name="description" cols="79" rows="3"></textarea>
								</p>
								
								<p>
									<input class="button" type="submit" value="Submit" />
							  </p>
								
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						</form>
					
					</div> 
					<!-- End #tab2 -->  
	
					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box --><!-- End .content-box --><!-- End .content-box -->
	    <div class="clear"></div>
<{include file="admin/footer.html"}>
<script>
function delconfirm(id,title){
	if( window.confirm("确定删除“" + title + "”？") ){
		window.location = "<{spUrl c=category a=del}>&id=" + id;
	}
}
</script>